/**
 * Copyright &copy; 2012-2016 civet All rights reserved.
 */
package cn.mcsys.myadmin.modules.air.entity;

import cn.mcsys.myadmin.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import java.util.Date;

/**
 * 停车场管理Entity
 * @author leopold
 * @version 2018-08-13
 */
public class AirParkingLot extends DataEntity<AirParkingLot> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 停车场名称
	private String position;		// 停车场位置
	private Integer parkingType;	//停车场类型
	private Long maxParking;		// 最大停车数量
	private String camera1;		// 摄像头1
	private String camera2;		// 摄像头2
	private String camera3;		// 摄像头3
	private String camera4;		// 摄像头4
	private String leader;		// 负责人
	private String phone;		// phone
	private String lon;		// 经度
	private String lat;		// 维度
	private Date modificationDate;		// 修改时间
	private String note;		// 备注
	
	public AirParkingLot() {
		super();
	}

	public AirParkingLot(Integer id){
		super(id);
	}

	public Integer getParkingType() {
		return parkingType;
	}

	public void setParkingType(Integer parkingType) {
		this.parkingType = parkingType;
	}

	@Length(min=0, max=16, message="停车场名称长度必须介于 0 和 16 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=255, message="停车场位置长度必须介于 0 和 255 之间")
	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	@Digits(integer = 5000,fraction = 0)
	public Long getMaxParking() {
		return maxParking;
	}

	public void setMaxParking(Long maxParking) {
		this.maxParking = maxParking;
	}
	
	@Length(min=0, max=255, message="摄像头1长度必须介于 0 和 255 之间")
	public String getCamera1() {
		return camera1;
	}

	public void setCamera1(String camera1) {
		this.camera1 = camera1;
	}
	
	@Length(min=0, max=255, message="摄像头2长度必须介于 0 和 255 之间")
	public String getCamera2() {
		return camera2;
	}

	public void setCamera2(String camera2) {
		this.camera2 = camera2;
	}
	
	@Length(min=0, max=255, message="摄像头3长度必须介于 0 和 255 之间")
	public String getCamera3() {
		return camera3;
	}

	public void setCamera3(String camera3) {
		this.camera3 = camera3;
	}
	
	@Length(min=0, max=255, message="摄像头3长度必须介于 0 和 255 之间")
	public String getCamera4() {
		return camera4;
	}

	public void setCamera4(String camera4) {
		this.camera4 = camera4;
	}
	
	@Length(min=0, max=16, message="负责人长度必须介于 0 和 16 之间")
	public String getLeader() {
		return leader;
	}

	public void setLeader(String leader) {
		this.leader = leader;
	}
	
	@Length(min=0, max=16, message="phone长度必须介于 0 和 16 之间")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public Date getModificationDate() {
		return modificationDate;
	}

	public void setModificationDate(Date modificationDate) {
		this.modificationDate = modificationDate;
	}
	
	@Length(min=0, max=64, message="备注长度必须介于 0 和 64 之间")
	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public String getLon() {
		return lon;
	}

	public void setLon(String lon) {
		this.lon = lon;
	}

	public String getLat() {
		return lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	/**
	 * 获取摄像头个数
	 * @return
	 */
	public String getCameraSum(){
		int sum = 0;
		if(camera1 != null){
			sum++;
		}
		if(camera2 != null){
			sum++;
		}
		if(camera3 != null){
			sum++;
		}
		if(camera4 != null){
			sum++;
		}
		return sum + "个";
	}
	
}